<?php


namespace app\library;


use think\console\Command;
use think\console\Input;
use think\console\Output;

class HandleImage extends Command
{
    private $size;

    public function __construct()
    {
        $this->size = 750;
    }

    public function execute($filename)
    {
        $filename = '/home/work/111111.jpg';
        $ret = getimagesize($filename);
        var_dump($ret);
        $image = \think\Image::open($filename);
        $scale = $image->width() / $this->size;
        $image->thumb($this->size, $image->height() * $scale)->save('./thumb.png');
        //$image->text('漫社互动','HYQingKongTiJ.ttf',20,'#ffffff')->save('text_image.png');
    }
}